sh_srv: device_communication.o mqttclient_communication.o main.o
	g++ $^ -lpthread -lpaho-mqtt3a -o sh_srv

device_communication.o: device_communication.cpp device_communication.h mqttclient_communication.h
	g++ -c device_communication.cpp

mqttclient_communication.o: mqttclient_communication.cpp device_communication.h mqttclient_communication.h
	g++ -c mqttclient_communication.cpp

main.o: main.cpp device_communication.h mqttclient_communication.h
	g++ -c main.cpp

.PHONY: clean install  # 声明伪目标

clean:
	rm *.o
	echo test

install:
	sudo cp sh_srv /bin
